<template>
  <div>
    <button @click="create">设置水印</button>
    <button @click="reset">关闭水印</button>
  </div>
</template>

<script>
import { Watermark } from "watermark-js-plus";
export default {
  data() {
    return {
      watermark: null,
    };
  },
  mounted() {
    this.watermark = new Watermark({
      content: "hello my watermark",
      width: 200,
      height: 200,
      onSuccess: () => {
        // success callback
      },
    });
  },
  methods: {
    create() {
      this.watermark.create();
      console.log("this.watermark", this.watermark);
    },
    reset(){
      this.watermark.destroy();
      
    }
  },
};
</script>
<style scoped lang="less"></style>
